use "cgk_replication_data.dta", replace
set more off

* Demos *
gen white = 0
replace white = 1 if race == 1
gen education = educ
gen age = 2015-birthyr
gen male = 0
replace male = 1 if gender == 1
gen income = faminc 
replace income = . if faminc == 97

* Party *
gen dem3 = 0
replace dem3 = 1 if pid7 == 1
replace dem3 = 1 if pid7 == 2
gen dem5 = dem3
replace dem5 = 1 if pid7 == 3
gen gop3 = 0
replace gop3 = 1 if pid7 == 7
replace gop3 = 1 if pid7 == 6
gen gop5 = gop3
replace gop5 = 1 if pid7 == 5
gen ind5 = 0
replace ind5 = 1 if gop5 == 0 & dem5 == 0

* Ideology *
gen ideology = ideo5
recode ideology (6=3)
gen ideology2 = ideo5
replace ideology2 = . if ideology2 == 6

* Climate Change *
gen climatechangeserious = 0
replace climatechangeserious = 1 if BOS102 == 1
replace climatechangeserious = 1 if BOS102 == 2

* Fracking *

* Main DV *
gen frackingsupport = 0
replace frackingsupport = 1 if BOS103 == 1
replace frackingsupport = 1 if BOS103 == 2

* Ordinal DV with 3 options -- oppose; DK; support *
gen fracking3 = .
replace fracking3 = 1 if BOS103 == 5
replace fracking3 = 1 if BOS103 == 4
replace fracking3 = 2 if BOS103 == 3
replace fracking3 = 3 if BOS103 == 2
replace fracking3 = 3 if BOS103 == 1

* Orindal DV with 5 options -- strongly oppose to strongly support *
gen fracking5= BOS103
recode fracking5 (5=1) (4=2) (2=4) (1=5)

* Treatment indicators *
tab BOS103_rand, gen(treatments)
ren treatments1 frackcontrol
ren treatments2 frackbenefits
ren treatments3 frackcosts
ren treatments4 frackboth
gen treatment = BOS103_rand

* Subgroups *
gen demfrackingsupport = frackingsupport
gen gopfrackingsupport = frackingsupport
replace demfrackingsupport = . if dem5 == 0
replace gopfrackingsupport = . if gop5 == 0
gen conflicted = 0
replace conflicted = 1 if gop5 == 1 & climatechangeserious == 1
replace conflicted = 1 if dem5 == 1 & climatechangeserious == 0
gen conflfrackingsupport = frackingsupport
gen notconflfrackingsupport = frackingsupport
replace conflfrackingsupport = . if conflicted == 0
replace notconflfrackingsupport = . if conflicted == 1

* Labels *
label var dem5 "Democrat"
label var gop5 "Republican"
label var dem3 "Democrat (no leaners)"
label var gop3 "Republican (no leaners)"
label var education "Education"
label var age "Age"
label var white "White"
label var male "Male"
label var ideology "Ideology"
label var ideology2 "Ideology (missing)"
label var climatechangeserious "Climate change serious"
label var frackbenefits "Benefits treatment"
label var frackcosts "Costs treatment"
label var frackboth "Costs and Benefits treatment"
label define treatments 1 "Control" 2 "Benefits" 3 "Costs" 4 "Costs and Benefits"
label values treatment treatments

* Figure 1 *
graph bar frackingsupport, over(treatment) ytitle("% Supporting Fracking" " ") graphregion(color(white)) bar(1, color(black) lcolor(black)) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80")

* Figure 2 *
graph bar gopfrackingsupport demfrackingsupport, over(treatment) ytitle("% Supporting Fracking" " ") graphregion(color(white)) bar(1, color(black) lcolor(black)) bar(2, color(gray) lcolor(black)) legend(label(1 "Republicans") label(2 "Democrats")) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80")

* Figure 3 *
graph bar conflfrackingsupport notconflfrackingsupport, over(treatment) ytitle("% Supporting Fracking" " ") graphregion(color(white)) bar(1, color(black) lcolor(black)) bar(2, color(gray) lcolor(black)) legend(label(1 "Conflicted") label(2 "Not Conflicted")) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80")

* SI Table 1: Randomization Checks *
oneway dem5 treatment, tab
oneway gop5 treatment, tab
oneway ideology treatment, tab
oneway education treatment, tab
oneway age treatment, tab
oneway white treatment, tab
oneway male treatment, tab
oneway climatechangeserious treatment, tab

* SI Table 2: Sample Summary Statistics *
sum white male 
tab educ
tab religpew
sum gop5 dem5 
tab ideo5

* SI Table 3: Variable Summary Statistics *
sum frackingsupport
tab frackingsupport
sum climatechangeserious
tab pid7
sum educ
tab educ
sum age
tab race
tab gender

* SI Table 4: Significance tests for differences in means *

* All *
oneway frackingsupport treatment, bonferroni tab

* Democrats *
oneway frackingsupport treatment if dem5 == 1, bonferroni tab

* Republicans *
oneway frackingsupport treatment if gop5 == 1, bonferroni tab

* Conflicted partisans *
oneway frackingsupport treatment if conflicted == 1 & ind5!=1, bonferroni tab

* Not conflicted partisans *
oneway frackingsupport treatment if conflicted == 0 & ind5!=1, bonferroni tab

* SI Table 5: Logistic Regressions *
logit frackingsupport frackbenefits frackcosts frackboth dem5 gop5 education age white male climatechangeserious
outreg2 using sitable5, word label replace dec(2)
logit frackingsupport frackbenefits frackcosts frackboth  education age white male climatechangeserious if dem5 == 1
outreg2 using sitable5, word label append dec(2)
logit frackingsupport frackbenefits frackcosts frackboth   education age white male climatechangeserious if gop5 == 1
outreg2 using sitable5, word label append dec(2)
logit frackingsupport frackbenefits frackcosts frackboth gop5  education age white male  if conflicted == 1
outreg2 using sitable5, word label append dec(2)
logit frackingsupport frackbenefits frackcosts frackboth gop5 education age white male  if conflicted == 0 & ind5!=1
outreg2 using sitable5, word label append dec(2)

* SI Table 6: Ordered Logits *
ologit fracking5 frackbenefits frackcosts frackboth dem5 gop5 education age white male climatechangeserious
outreg2 using sitable6, word label replace dec(2)
ologit fracking5 frackbenefits frackcosts frackboth  education age white male climatechangeserious if dem5 == 1
outreg2 using sitable6, word label append dec(2)
ologit fracking5 frackbenefits frackcosts frackboth   education age white male climatechangeserious if gop5 == 1
outreg2 using sitable6, word label append dec(2)
ologit fracking5 frackbenefits frackcosts frackboth gop5  education age white male  if conflicted == 1
outreg2 using sitable6, word label append dec(2)
ologit fracking5 frackbenefits frackcosts frackboth gop5 education age white male  if conflicted == 0 & ind5!=1
outreg2 using sitable6, word label append dec(2)

* SI Table 7: Multinomial Logits *
mlogit fracking3 frackbenefits frackcosts frackboth dem5 gop5 education age white male climatechangeserious, base(2)
outreg2 using sitable7, word label replace dec(2)
mlogit fracking3 frackbenefits frackcosts frackboth  education age white male climatechangeserious if dem5 == 1, base(2)
outreg2 using sitable7, word label append dec(2)
mlogit fracking3 frackbenefits frackcosts frackboth   education age white male climatechangeserious if gop5 == 1, base(2)
outreg2 using sitable7, word label append dec(2)
mlogit fracking3 frackbenefits frackcosts frackboth gop5  education age white male  if conflicted == 1, base(2)
outreg2 using sitable7, word label append dec(2)
mlogit fracking3 frackbenefits frackcosts frackboth gop5 education age white male  if conflicted == 0 & ind5!=1, base(2)
outreg2 using sitable7, word label append dec(2)

* SI Table 8: Effects by College Education *

gen somecollege = 0
replace somecollege = 1 if educ > 3
gen benefitsxsomecollege = frackbenefits*somecollege
gen costsxsomecollege = frackcosts*somecollege
gen bothxsomecollege = frackboth*somecollege
label var somecollege "College degree"
label var benefitsxsomecollege "Benefits treatment * College"
label var costsxsomecollege "Costs treatment * College"
label var bothxsomecollege "Costs and benefits treatment * College"


logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if dem5 == 1
outreg2 using sitable8, word label replace dec(2)
logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if gop5 == 1
outreg2 using sitable8, word label append dec(2)

* SI Table 9: Effects by Educational Attainment *

gen benefitsxeducation = frackbenefits*education
gen costsxeducation = frackcosts *education
gen bothxeducation = frackboth*education
label var benefitsxeducation "Benefits treatment * Education"
label var costsxeducation "Costs treatment * Education"
label var bothxeducation "Costs and benefits treatment * Education"

logit frackingsupport frackbenefits frackcosts frackboth benefitsxeducation costsxeducation bothxeducation education if dem5 == 1
outreg2 using sitable9, word label replace dec(2)
logit frackingsupport frackbenefits frackcosts frackboth benefitsxeducation costsxeducation bothxeducation education if gop5 == 1
outreg2 using sitable9, word label append dec(2)

* Replication Code for Figures in Supporting Information *

* SI Figure 1 -- All *

gen means = .
gen ns = .
gen sds = .
gen ses = .
gen label = _n
replace label = . if label > 24

sum frackingsupport if frackcontrol == 1
replace means = r(mean) if label == 1
replace sds = r(sd) if label == 1
replace ns = r(N) if label == 1
replace ses = sds/sqrt(ns) if label == 1

sum frackingsupport if frackbenefits == 1
replace means = r(mean) if label == 2
replace sds = r(sd) if label == 2
replace ns = r(N) if label == 2
replace ses = sds/sqrt(ns) if label == 2

sum frackingsupport if frackcosts == 1
replace means = r(mean) if label == 3
replace sds = r(sd) if label == 3
replace ns = r(N) if label == 3
replace ses = sds/sqrt(ns) if label == 3

sum frackingsupport if frackboth == 1
replace means = r(mean) if label == 4
replace sds = r(sd) if label == 4
replace ns = r(N) if label == 4
replace ses = sds/sqrt(ns) if label == 4

serrbar mean se label if label < 5 & label > 1, scale(1.96) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80") xscale(range(1.75 4.25)) xlabel(2 "Benefits" 3 "Costs" 4 "Both") ytitle("% Supporting Fracking" " ") xtitle("") graphregion(color(white)) yline(`=means[1]')


* SI Figure 2: Democrats *

sum frackingsupport if frackcontrol == 1 & dem5 == 1
replace means = r(mean) if label == 5
replace sds = r(sd) if label == 5
replace ns = r(N) if label == 5
replace ses = sds/sqrt(ns) if label == 5

sum frackingsupport if frackbenefits == 1 & dem5 == 1
replace means = r(mean) if label == 6
replace sds = r(sd) if label == 6
replace ns = r(N) if label == 6
replace ses = sds/sqrt(ns) if label == 6

sum frackingsupport if frackcosts == 1 & dem5 == 1
replace means = r(mean) if label == 7
replace sds = r(sd) if label == 7
replace ns = r(N) if label == 7
replace ses = sds/sqrt(ns) if label == 7

sum frackingsupport if frackboth == 1 & dem5 == 1
replace means = r(mean) if label == 8
replace sds = r(sd) if label == 8
replace ns = r(N) if label == 8
replace ses = sds/sqrt(ns) if label == 8

serrbar mean se label if label > 5 & label < 9, scale(1.96)  ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80")  xscale(range(5.75 8.25)) xlabel( 6 "Benefits" 7 "Costs" 8 "Both") ytitle("% Supporting Fracking" " ") xtitle("") title(Democrats) graphregion(color(white)) yline(`=means[5]')


* SI Figure 2: Republicans *

sum frackingsupport if frackcontrol == 1 & gop5 == 1
replace means = r(mean) if label == 9
replace sds = r(sd) if label == 9
replace ns = r(N) if label == 9
replace ses = sds/sqrt(ns) if label == 9

sum frackingsupport if frackbenefits == 1 & gop5 == 1
replace means = r(mean) if label == 10
replace sds = r(sd) if label == 10
replace ns = r(N) if label == 10
replace ses = sds/sqrt(ns) if label == 10

sum frackingsupport if frackcosts == 1 & gop5 == 1
replace means = r(mean) if label == 11
replace sds = r(sd) if label == 11
replace ns = r(N) if label == 11
replace ses = sds/sqrt(ns) if label == 11

sum frackingsupport if frackboth == 1 & gop5 == 1
replace means = r(mean) if label == 12
replace sds = r(sd) if label == 12
replace ns = r(N) if label == 12
replace ses = sds/sqrt(ns) if label == 12

serrbar mean se label if label > 9 & label < 13, scale(1.96)  ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80") xscale(range(9.75 12.25)) xlabel(10 "Benefits" 11 "Costs" 12 "Both") ytitle("% Supporting Fracking" " ") xtitle("") title(Republicans) graphregion(color(white)) yline(`=means[9]')

* SI Figure 3: conflicted *

sum frackingsupport if frackcontrol == 1 & conflicted == 1 & ind5 !=1
replace means = r(mean) if label == 17
replace sds = r(sd) if label == 17
replace ns = r(N) if label == 17
replace ses = sds/sqrt(ns) if label == 17

sum frackingsupport if frackbenefits == 1 & conflicted == 1 & ind5 !=1
replace means = r(mean) if label == 18
replace sds = r(sd) if label == 18
replace ns = r(N) if label == 18
replace ses = sds/sqrt(ns) if label == 18

sum frackingsupport if frackcosts == 1 & conflicted == 1 & ind5 !=1
replace means = r(mean) if label == 19
replace sds = r(sd) if label == 19
replace ns = r(N) if label == 19
replace ses = sds/sqrt(ns) if label == 19

sum frackingsupport if frackboth == 1 & conflicted == 1 & ind5 !=1
replace means = r(mean) if label == 20
replace sds = r(sd) if label == 20
replace ns = r(N) if label == 20
replace ses = sds/sqrt(ns) if label == 20


serrbar mean se label if label > 17 & label < 21, scale(1.96) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80")  xscale(range(17.75 20.25)) xlabel(18 "Benefits" 19 "Costs" 20 "Both") ytitle("% Supporting Fracking" " ") xtitle("") title(Conflicted) graphregion(color(white)) yline(`=means[17]')

* SI Figure 3: Not conflicted *

sum frackingsupport if frackcontrol == 1 & conflicted == 0 & ind5 !=1
replace means = r(mean) if label == 21
replace sds = r(sd) if label == 21
replace ns = r(N) if label == 21
replace ses = sds/sqrt(ns) if label == 21

sum frackingsupport if frackbenefits == 1 & conflicted == 0 & ind5 !=1
replace means = r(mean) if label == 22
replace sds = r(sd) if label == 22
replace ns = r(N) if label == 22
replace ses = sds/sqrt(ns) if label == 22

sum frackingsupport if frackcosts == 1 & conflicted == 0 & ind5 !=1
replace means = r(mean) if label == 23
replace sds = r(sd) if label == 23
replace ns = r(N) if label == 23
replace ses = sds/sqrt(ns) if label == 23

sum frackingsupport if frackboth == 1 & conflicted == 0 & ind5 !=1
replace means = r(mean) if label == 24
replace sds = r(sd) if label == 24
replace ns = r(N) if label == 24
replace ses = sds/sqrt(ns) if label == 24

serrbar mean se label if label > 21 & label < 25, scale(1.96) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80")  xscale(range(21.75 24.25)) xlabel(22 "Benefits" 23 "Costs" 24 "Both") ytitle("% Supporting Fracking" " ") xtitle("") title(Not Conflicted) graphregion(color(white)) yline(`=means[21]')

* SI Figure 4: Treatment effects from logit model: All *

gen fig1mean = .
gen fig1upper = .
gen fig1lower = .
gen fig1label = _n
replace fig1label = . if fig1label > 20
label define fig1labels 1 "Control" 2 "Benefits" 3 "Costs" 4 "Costs and Benefits" 5 "Control" 6 "Benefits" 7 "Costs" 8 "Costs and Benefits" 9 "Control" 10 "Benefits" 11 "Costs" 12 "Costs and Benefits" 13 "Control" 14 "Benefits" 15 "Costs" 16 "Costs and Benefits"  17 "Control" 18 "Benefits" 19 "Costs" 20 "Costs and Benefits" 
label values fig1label fig1labels
label var fig1label ""

estsimp logit frackingsupport frackbenefits frackcosts frackboth dem5 gop5 education age white male climatechangeserious 
setx median
setx dem5 0 gop5 0 male 0 climatechangeserious 0
setx frackbenefits 0 frackcosts 0 frackboth 0
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 1
replace fig1lower = r(r2) if fig1label == 1 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 1
drop x preds0 preds1

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 2
replace fig1lower = r(r2) if fig1label == 2 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 2
drop x preds0 preds1

setx frackbenefits 0 frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 3
replace fig1lower = r(r2) if fig1label == 3 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 3
drop x preds0 preds1

setx frackcosts 0 frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 4
replace fig1lower = r(r2) if fig1label == 4 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 4
drop x preds0 preds1 b1-b11 

eclplot fig1mean fig1lower fig1upper fig1label if fig1label >1 & fig1label < 5, ylabel(0 .1 .2 .3 .4 .5 .6 .7 .8) ytitle("Probability of supporting fracking" " ") xtitle("") xscale(range(1.75 4.25)) xlabel(2 "Benefits" 3 "Costs" 4 "Both") yline(`=fig1mean[1]') graphregion(color(white))

* SI Figure 5: Democrats *

estsimp logit frackingsupport frackbenefits frackcosts frackboth education age white male climatechangeserious if dem5 == 1
setx median
setx male 0 climatechangeserious 0
setx frackbenefits 0 frackcosts 0 frackboth 0
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 5
replace fig1lower = r(r2) if fig1label == 5 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 5
drop x preds0 preds1

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 6
replace fig1lower = r(r2) if fig1label == 6 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 6
drop x preds0 preds1

setx frackbenefits 0 frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 7
replace fig1lower = r(r2) if fig1label == 7 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 7
drop x preds0 preds1

setx frackcosts 0 frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 8
replace fig1lower = r(r2) if fig1label == 8 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 8
drop x preds0 preds1 b1-b9 

eclplot fig1mean fig1lower fig1upper fig1label if fig1label >5 & fig1label < 9, ylabel(0 .1 .2 .3 .4 .5 .6 .7 .8) ytitle("Probability of supporting fracking" " ") xtitle("") xscale(range(5.75 8.25)) xlabel(6 "Benefits" 7 "Costs" 8 "Both") yline(`=fig1mean[5]') graphregion(color(white)) title("Democrats")

* SI Figure 5: Republicans *
estsimp logit frackingsupport frackbenefits frackcosts frackboth education age white male climatechangeserious if gop5 == 1
setx median
setx male 0 climatechangeserious 0
setx frackbenefits 0 frackcosts 0 frackboth 0
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 9
replace fig1lower = r(r2) if fig1label == 9 
egen x = mean(preds1)
replace fig1mean = x if fig1label == 9
drop x preds0 preds1

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 10
replace fig1lower = r(r2) if fig1label == 10
egen x = mean(preds1)
replace fig1mean = x if fig1label == 10
drop x preds0 preds1

setx frackbenefits 0 frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 11
replace fig1lower = r(r2) if fig1label == 11
egen x = mean(preds1)
replace fig1mean = x if fig1label == 11
drop x preds0 preds1

setx frackcosts 0 frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 12
replace fig1lower = r(r2) if fig1label == 12
egen x = mean(preds1)
replace fig1mean = x if fig1label == 12
drop x preds0 preds1 b1-b9 

eclplot fig1mean fig1lower fig1upper fig1label if fig1label >9 & fig1label < 13, ylabel(0 .1 .2 .3 .4 .5 .6 .7 .8) ytitle("Probability of supporting fracking" " ") xtitle("") xscale(range(9.75 12.25)) xlabel(10 "Benefits" 11 "Costs" 12 "Both") yline(`=fig1mean[9]') graphregion(color(white)) title("Republicans")

* SI Figure 6: Conflicted *
estsimp logit frackingsupport frackbenefits frackcosts frackboth gop5  education age white male  if conflicted == 1
setx median
setx male 0 gop5 1
* Set GOP5 = 1 because a greater percentage of Republicans are conflicted than Democrats *
setx frackbenefits 0 frackcosts 0 frackboth 0
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 13
replace fig1lower = r(r2) if fig1label == 13
egen x = mean(preds1)
replace fig1mean = x if fig1label == 13
drop x preds0 preds1

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 14
replace fig1lower = r(r2) if fig1label == 14
egen x = mean(preds1)
replace fig1mean = x if fig1label == 14
drop x preds0 preds1

setx frackbenefits 0 frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 15
replace fig1lower = r(r2) if fig1label == 15
egen x = mean(preds1)
replace fig1mean = x if fig1label == 15
drop x preds0 preds1

setx frackcosts 0 frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 16
replace fig1lower = r(r2) if fig1label == 16
egen x = mean(preds1)
replace fig1mean = x if fig1label == 16
drop x preds0 preds1 b1-b9 

eclplot fig1mean fig1lower fig1upper fig1label if fig1label >13 & fig1label < 17, ylabel(0 .1 .2 .3 .4 .5 .6 .7 .8) ytitle("Probability of supporting fracking" " ") xtitle("") xscale(range(13.75 16.25)) xlabel(14 "Benefits" 15 "Costs" 16 "Both") yline(`=fig1mean[13]') graphregion(color(white)) title("Conflicted")

* SI Figure 6: Not Conflicted *

estsimp logit frackingsupport frackbenefits frackcosts frackboth gop5  education age white male  if conflicted == 0 & ind5!=1
setx median
setx male 0 gop5 1
setx frackbenefits 0 frackcosts 0 frackboth 0
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 17
replace fig1lower = r(r2) if fig1label == 17
egen x = mean(preds1)
replace fig1mean = x if fig1label == 17
drop x preds0 preds1

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 18
replace fig1lower = r(r2) if fig1label == 18
egen x = mean(preds1)
replace fig1mean = x if fig1label == 18
drop x preds0 preds1

setx frackbenefits 0 frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 19
replace fig1lower = r(r2) if fig1label == 19
egen x = mean(preds1)
replace fig1mean = x if fig1label == 19
drop x preds0 preds1

setx frackcosts 0 frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig1upper = r(r1) if fig1label == 20
replace fig1lower = r(r2) if fig1label == 20
egen x = mean(preds1)
replace fig1mean = x if fig1label == 20
drop x preds0 preds1 b1-b9 

eclplot fig1mean fig1lower fig1upper fig1label if fig1label >17 & fig1label < 21, ylabel(0 .1 .2 .3 .4 .5 .6 .7 .8) ytitle("Probability of supporting fracking" " ") xtitle("") xscale(range(17.75 20.25)) xlabel(18 "Benefits" 19 "Costs" 20 "Both") yline(`=fig1mean[17]') graphregion(color(white)) title("Not Conflicted")

* SI Figure 7: Illustrate Effects of All Variables *

gen fig2mean = .
gen fig2upper = .
gen fig2lower = .
gen fig2label = _n
replace fig2label = . if fig2label > 11
label define fig2labels 1 "Control" 2 "Benefits" 3 "Costs" 4 "Costs and Benefits" 5 "Republican" 6 "Democrat" 7 "Education" 8 "Age" 9 "Non-white" 10 "Male" 11 "Climate change serious"
label values fig2label fig2labels
label var fig2label ""

estsimp logit frackingsupport frackbenefits frackcosts frackboth dem5 gop5 education age white male climatechangeserious 
setx median
setx dem5 0 gop5 0 male 0 climatechangeserious 0
setx frackbenefits 0 frackcosts 0 frackboth 0
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 1
replace fig2lower = r(r2) if fig2label == 1 
egen x = mean(preds1)
egen baseline = mean(preds1)
replace fig2mean = x if fig2label == 1
drop x preds0 preds1

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 2
replace fig2lower = r(r2) if fig2label == 2 
egen x = mean(preds1)
replace fig2mean = x if fig2label == 2
drop x preds0 preds1

setx frackbenefits 0 frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 3
replace fig2lower = r(r2) if fig2label == 3 
egen x = mean(preds1)
replace fig2mean = x if fig2label == 3
drop x preds0 preds1

setx frackcosts 0 frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 4
replace fig2lower = r(r2) if fig2label == 4 
egen x = mean(preds1)
replace fig2mean = x if fig2label == 4
drop x preds0 preds1

setx frackboth 0
setx gop5 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 5
replace fig2lower = r(r2) if fig2label == 5 
egen x = mean(preds1)
replace fig2mean = x if fig2label == 5
drop x preds0 preds1

setx gop5 0 dem5 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 6
replace fig2lower = r(r2) if fig2label == 6 
egen x = mean(preds1)
replace fig2mean = x if fig2label == 6
drop x preds0 preds1

setx dem5 0 education 6
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 7
replace fig2lower = r(r2) if fig2label == 7 
egen x = mean(preds1)
replace fig2mean = x if fig2label == 7
drop x preds0 preds1

setx education median age 80
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 8
replace fig2lower = r(r2) if fig2label == 8 
egen x = mean(preds1)
replace fig2mean = x if fig2label == 8
drop x preds0 preds1

setx age median white 0
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 9
replace fig2lower = r(r2) if fig2label == 9
egen x = mean(preds1)
replace fig2mean = x if fig2label == 9
drop x preds0 preds1

setx white 1 male 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 10
replace fig2lower = r(r2) if fig2label == 10
egen x = mean(preds1)
replace fig2mean = x if fig2label == 10
drop x preds0 preds1

setx male 0 climatechangeserious 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace fig2upper = r(r1) if fig2label == 11
replace fig2lower = r(r2) if fig2label == 11
egen x = mean(preds1)
replace fig2mean = x if fig2label == 11
drop x preds0 preds1

drop b1-b11

eclplot fig2mean fig2lower fig2upper fig2label if fig2label >1 & fig2label < 12, ylabel(0 .1 .2 .3 .4 .5 .6 ) ytitle("Probability of supporting fracking" " ") xtitle("") xscale(range(1.75 11.25)) xlabel( 2 "Benefits" 3 "Costs" 4 "Costs and Benefits" 5 "Republican" 6 "Democrat" 7 "Education" 8 "Age" 9 "Non-white" 10 "Male" 11 "Climate change serious",angle(vertical)) yline(`=fig2mean[1]') graphregion(color(white)) 

* SI Figure 8 *

* Democrats *
graph bar conflfrackingsupport notconflfrackingsupport if dem5 == 1, over(treatment) ytitle("% Supporting Fracking" " ") graphregion(color(white)) bar(1, color(black) lcolor(black)) bar(2, color(gray) lcolor(black)) legend(label(1 "Conflicted") label(2 "Not Conflicted")) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80") title("Democrats")

* Significance tests *
oneway frackingsupport treatment if conflicted == 1 & dem5 == 1, bonferroni
oneway frackingsupport treatment if conflicted == 0 & dem5 == 1, bonferroni

* Republicans *
graph bar conflfrackingsupport notconflfrackingsupport if gop5 == 1, over(treatment) ytitle("% Supporting Fracking" " ") graphregion(color(white)) bar(1, color(black) lcolor(black)) bar(2, color(gray) lcolor(black)) legend(label(1 "Conflicted") label(2 "Not Conflicted")) ylabel(0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70" .8 "80") title("Republicans")

* Significance tests *
oneway frackingsupport treatment if conflicted == 1 & gop5 == 1, bonferroni
oneway frackingsupport treatment if conflicted == 0 & gop5 == 1, bonferroni

* SI Figure 9 *

* Democrats *
gen lower = .
gen estimate = .
gen upper = .
gen figcollegelabel = _n
replace figcollegelabel = . if figcollegelabel > 4
label define figcollegelabels 1 "No college" 2 "College"
label values figcollegelabel figcollegelabels

estsimp logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if dem5 == 1
setx frackbenefits 0 frackcosts 0 frackboth 0 benefitsxsomecollege 0 costsxsomecollege 0 bothxsomecollege 0 somecollege 0
simqi, genpr(preds0 preds1)
egen baselinelowed = mean(preds1)
drop preds0 preds1
setx somecollege 1
simqi, genpr(preds0 preds1)
egen baselinehied = mean(preds1)
drop preds0 preds1
setx somecollege 0

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinelowed[1]' if figcollegelabel == 1
replace lower = r(r2)-`=baselinelowed[1]' if figcollegelabel == 1 
egen x = mean(preds1)
replace estimate = x-`=baselinelowed[1]' if figcollegelabel == 1
drop x preds0 preds1

setx benefitsxsomecollege 1 somecollege 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinehied[1]' if figcollegelabel == 2
replace lower = r(r2)-`=baselinehied[1]' if figcollegelabel == 2 
egen x = mean(preds1)
replace estimate = x-`=baselinehied[1]' if figcollegelabel == 2
drop x preds0 preds1

eclplot estimate lower upper figcollegelabel, ylabel(.3 .2 .1 0 -.1) ytitle("Change in probability" " ") xscale(range(.5 2.5)) xlabel(1 2) xtitle(" ") yline(0) graphregion(fcolor(white))  ciopts(blcolor(black)) estopts(mcolor(black) msymbol(circle)) title(Democrats)

* Republicans *
drop b1-b8 baselinelowed baselinehied lower upper estimate figcollegelabel
label drop figcollegelabels

gen lower = .
gen estimate = .
gen upper = .
gen figcollegelabel = _n
replace figcollegelabel = . if figcollegelabel > 4
label define figcollegelabels 1 "No college" 2 "College"
label values figcollegelabel figcollegelabels


estsimp logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if gop5 == 1
setx frackbenefits 0 frackcosts 0 frackboth 0 benefitsxsomecollege 0 costsxsomecollege 0 bothxsomecollege 0 somecollege 0
simqi, genpr(preds0 preds1)
egen baselinelowed = mean(preds1)
drop preds0 preds1
setx somecollege 1
simqi, genpr(preds0 preds1)
egen baselinehied = mean(preds1)
drop preds0 preds1
setx somecollege 0

setx frackbenefits 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinelowed[1]' if figcollegelabel == 1
replace lower = r(r2)-`=baselinelowed[1]' if figcollegelabel == 1 
egen x = mean(preds1)
replace estimate = x-`=baselinelowed[1]' if figcollegelabel == 1
drop x preds0 preds1

setx benefitsxsomecollege 1 somecollege 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinehied[1]' if figcollegelabel == 2
replace lower = r(r2)-`=baselinehied[1]' if figcollegelabel == 2 
egen x = mean(preds1)
replace estimate = x-`=baselinehied[1]' if figcollegelabel == 2
drop x preds0 preds1

eclplot estimate lower upper figcollegelabel, ylabel(.3 .2 .1 0 -.1) ytitle("Change in probability" " ") xscale(range(.5 2.5)) xlabel(1 2) xtitle(" ") yline(0) graphregion(fcolor(white))  ciopts(blcolor(black)) estopts(mcolor(black) msymbol(circle)) title(Republicans)

* SI Figure 10 *

* Democrats *
drop b1-b8 baselinelowed baselinehied lower upper estimate figcollegelabel
label drop figcollegelabels
gen lower = .
gen estimate = .
gen upper = .
gen figcollegelabel = _n
replace figcollegelabel = . if figcollegelabel > 4
label define figcollegelabels 1 "No college" 2 "College"
label values figcollegelabel figcollegelabels

estsimp logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if dem5 == 1
setx frackbenefits 0 frackcosts 0 frackboth 0 benefitsxsomecollege 0 costsxsomecollege 0 bothxsomecollege 0 somecollege 0
simqi, genpr(preds0 preds1)
egen baselinelowed = mean(preds1)
drop preds0 preds1
setx somecollege 1
simqi, genpr(preds0 preds1)
egen baselinehied = mean(preds1)
drop preds0 preds1
setx somecollege 0

setx frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinelowed[1]' if figcollegelabel == 1
replace lower = r(r2)-`=baselinelowed[1]' if figcollegelabel == 1 
egen x = mean(preds1)
replace estimate = x-`=baselinelowed[1]' if figcollegelabel == 1
drop x preds0 preds1

setx costsxsomecollege 1 somecollege 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinehied[1]' if figcollegelabel == 2
replace lower = r(r2)-`=baselinehied[1]' if figcollegelabel == 2 
egen x = mean(preds1)
replace estimate = x-`=baselinehied[1]' if figcollegelabel == 2
drop x preds0 preds1

eclplot estimate lower upper figcollegelabel, ylabel(.3 .2 .1 0 -.1) ytitle("Change in probability" " ") xscale(range(.5 2.5)) xlabel(1 2) xtitle(" ") yline(0) graphregion(fcolor(white))  ciopts(blcolor(black)) estopts(mcolor(black) msymbol(circle)) title(Democrats)

* Republicans *
drop b1-b8 baselinelowed baselinehied lower upper estimate figcollegelabel
label drop figcollegelabels

gen lower = .
gen estimate = .
gen upper = .
gen figcollegelabel = _n
replace figcollegelabel = . if figcollegelabel > 4
label define figcollegelabels 1 "No college" 2 "College"
label values figcollegelabel figcollegelabels


estsimp logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if gop5 == 1
setx frackbenefits 0 frackcosts 0 frackboth 0 benefitsxsomecollege 0 costsxsomecollege 0 bothxsomecollege 0 somecollege 0
simqi, genpr(preds0 preds1)
egen baselinelowed = mean(preds1)
drop preds0 preds1
setx somecollege 1
simqi, genpr(preds0 preds1)
egen baselinehied = mean(preds1)
drop preds0 preds1
setx somecollege 0

setx frackcosts 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinelowed[1]' if figcollegelabel == 1
replace lower = r(r2)-`=baselinelowed[1]' if figcollegelabel == 1 
egen x = mean(preds1)
replace estimate = x-`=baselinelowed[1]' if figcollegelabel == 1
drop x preds0 preds1

setx costsxsomecollege 1 somecollege 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinehied[1]' if figcollegelabel == 2
replace lower = r(r2)-`=baselinehied[1]' if figcollegelabel == 2 
egen x = mean(preds1)
replace estimate = x-`=baselinehied[1]' if figcollegelabel == 2
drop x preds0 preds1

eclplot estimate lower upper figcollegelabel, ylabel(.3 .2 .1 0 -.1) ytitle("Change in probability" " ") xscale(range(.5 2.5)) xlabel(1 2) xtitle(" ") yline(0) graphregion(fcolor(white))  ciopts(blcolor(black)) estopts(mcolor(black) msymbol(circle)) title(Republicans)

* SI Figure 11 *
* Democrats *
drop b1-b8 baselinelowed baselinehied lower upper estimate figcollegelabel
label drop figcollegelabels
gen lower = .
gen estimate = .
gen upper = .
gen figcollegelabel = _n
replace figcollegelabel = . if figcollegelabel > 4
label define figcollegelabels 1 "No college" 2 "College"
label values figcollegelabel figcollegelabels

estsimp logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if dem5 == 1
setx frackbenefits 0 frackcosts 0 frackboth 0 benefitsxsomecollege 0 costsxsomecollege 0 bothxsomecollege 0 somecollege 0
simqi, genpr(preds0 preds1)
egen baselinelowed = mean(preds1)
drop preds0 preds1
setx somecollege 1
simqi, genpr(preds0 preds1)
egen baselinehied = mean(preds1)
drop preds0 preds1
setx somecollege 0

setx frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinelowed[1]' if figcollegelabel == 1
replace lower = r(r2)-`=baselinelowed[1]' if figcollegelabel == 1 
egen x = mean(preds1)
replace estimate = x-`=baselinelowed[1]' if figcollegelabel == 1
drop x preds0 preds1

setx bothxsomecollege 1 somecollege 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinehied[1]' if figcollegelabel == 2
replace lower = r(r2)-`=baselinehied[1]' if figcollegelabel == 2 
egen x = mean(preds1)
replace estimate = x-`=baselinehied[1]' if figcollegelabel == 2
drop x preds0 preds1

eclplot estimate lower upper figcollegelabel, ylabel(.3 .2 .1 0 -.1) ytitle("Change in probability" " ") xscale(range(.5 2.5)) xlabel(1 2) xtitle(" ") yline(0) graphregion(fcolor(white))  ciopts(blcolor(black)) estopts(mcolor(black) msymbol(circle)) title(Democrats)

* Republicans *
drop b1-b8 baselinelowed baselinehied lower upper estimate figcollegelabel
label drop figcollegelabels

gen lower = .
gen estimate = .
gen upper = .
gen figcollegelabel = _n
replace figcollegelabel = . if figcollegelabel > 4
label define figcollegelabels 1 "No college" 2 "College"
label values figcollegelabel figcollegelabels


estsimp logit frackingsupport frackbenefits frackcosts frackboth benefitsxsomecollege costsxsomecollege bothxsomecollege somecollege if gop5 == 1
setx frackbenefits 0 frackcosts 0 frackboth 0 benefitsxsomecollege 0 costsxsomecollege 0 bothxsomecollege 0 somecollege 0
simqi, genpr(preds0 preds1)
egen baselinelowed = mean(preds1)
drop preds0 preds1
setx somecollege 1
simqi, genpr(preds0 preds1)
egen baselinehied = mean(preds1)
drop preds0 preds1
setx somecollege 0

setx frackboth 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinelowed[1]' if figcollegelabel == 1
replace lower = r(r2)-`=baselinelowed[1]' if figcollegelabel == 1 
egen x = mean(preds1)
replace estimate = x-`=baselinelowed[1]' if figcollegelabel == 1
drop x preds0 preds1

setx bothxsomecollege 1 somecollege 1
simqi, genpr(preds0 preds1)
_pctile preds1, p(2.5,97.5)
replace upper = r(r1)-`=baselinehied[1]' if figcollegelabel == 2
replace lower = r(r2)-`=baselinehied[1]' if figcollegelabel == 2 
egen x = mean(preds1)
replace estimate = x-`=baselinehied[1]' if figcollegelabel == 2
drop x preds0 preds1

eclplot estimate lower upper figcollegelabel, ylabel(.3 .2 .1 0 -.1) ytitle("Change in probability" " ") xscale(range(.5 2.5)) xlabel(1 2) xtitle(" ") yline(0) graphregion(fcolor(white))  ciopts(blcolor(black)) estopts(mcolor(black) msymbol(circle)) title(Republicans)


* SI Figure 12 *

* Republicans *
logit frackingsupport  i.frackbenefits##c.education i.frackcosts##c.education i.frackboth##c.education if gop5 == 1
margins, at(education=(1(1)6) frackbenefits=(0 1) frackcosts=0 frackboth = 0) vsquish
marginsplot, x(education)  recast(line) title("") yti("Probability of supporting fracking") legend(order(1 "Control" 2 "Treatment") ring(0) pos(8) cols(1)) scheme(s1mono) recastci(rarea) ci1opts(fintensity(20)) level(95)

* Democrats *
logit frackingsupport  i.frackbenefits##c.education i.frackcosts##c.education i.frackboth##c.education if dem5 == 1
margins, at(education=(1(1)6) frackbenefits=(0 1) frackcosts=0 frackboth = 0) vsquish
marginsplot, x(education)  recast(line) title("") yti("Probability of supporting fracking") legend(order(1 "Control" 2 "Treatment") ring(0) pos(8) cols(1)) scheme(s1mono) recastci(rarea) ci1opts(fintensity(20)) level(95)

* SI Figure 13 *

* Republicans *
logit frackingsupport  i.frackbenefits##c.education i.frackcosts##c.education i.frackboth##c.education if gop5 == 1
margins, at(education=(1(1)6) frackboth=(0 1) frackbenefits=0 frackcosts=0) vsquish
marginsplot, x(education)  recast(line) title("") yti("Probability of supporting fracking") legend(order(1 "Control" 2 "Treatment") ring(0) pos(8) cols(1)) scheme(s1mono) recastci(rarea) ci1opts(fintensity(20)) level(95)

* Democrats *
logit frackingsupport  i.frackbenefits##c.education i.frackcosts##c.education i.frackboth##c.education if dem5 == 1
margins, at(education=(1(1)6) frackboth=(0 1) frackbenefits=0 frackcosts=0) vsquish
marginsplot, x(education)  recast(line) title("") yti("Probability of supporting fracking") legend(order(1 "Control" 2 "Treatment") ring(0) pos(8) cols(1)) scheme(s1mono) recastci(rarea) ci1opts(fintensity(20)) level(95)


